<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <div id="app">
        <h1>{{ msg }}</h1>
        <h2>我的名字是{{ obj.name }}，我的年龄是{{ obj.age }}！！！</h2>
        <button @click="onclick">给我变</button>
    </div>
    <script>
        const { createApp, ref } = Vue
        createApp({
            setup() {
                const msg = ref('你好世界')
                const obj = ref({
                    name : '小bite',
                    age : 18
                })
                const onclick = () => {
                    msg.value = '不好世界'
                    obj.value.name = '大bite'
                    obj.value.age = 100
                }
                return { obj, msg, onclick }
            }
        }).mount('#app')
    </script>
</body>
</html>